<!-- 浮层 -->
<view id='float_view' wx:if="{{showFloat}}" bindtap='hideView'></view>

<view id='info_view' wx:if="{{showInfo}}" >
    <label class="msg">确认充值</label>
    <li>
        <label><image class='icon' src="{{urlAddress}}/me_icon_youhui.png" />优惠信息:</label>
        <label>{{promLabel}}</label>
    </li>
     <li>
        <label><image class='icon' src="{{urlAddress}}/meal_icon_shop.png" />参与门店:</label>
        <label >{{shopName}}</label>
    </li>
    <label class="make_style"><p bindtap='hideView'>取消</p><p bindtap='makeSureRecharge'>确认</p></label>
</view>


<view class="recharge">
     <view class='top_style' wx:if='{{isShowMaiXiang}}'>{{MaiXiangMsg}}</view>
    <view class="info">
        <view class="balance">
            我的余额: <text> {{balance}}</text>
        </view>
        <view class="header">
            <text>选择充值金额</text>
        </view>
        <view class="list" >
            <view class="item {{item.isSelect?'active':''}}" wx:for="{{resultList}}" wx:key="item" bindtap='select' data-rechargeAmount="{{util.formatNum(item.rechargeAmount)}}" data-presentAmount="{{util.formatNum(item.presentAmount)}}" data-index="{{index}}">
                <view>{{util.formatNum(item.rechargeAmount) }}元</view>
                <view>赠{{util.formatNum(item.presentAmount) }}元</view>
            </view>
        </view>
        <view class="rechargeInput">
            <input value="{{rechargeAmount}}" bindblur="bindKeyInput"   maxlength="6" type="number" placeholder="请输入充值金额（元）" />
        </view>
    </view>
    <view class="method">
        <view>充值方式</view>
        <view>
            <view>
                <image src="{{imageUrl}}/icon_wechat.png"></image>
                <text>微信支付</text>  
            </view>
            <image src="{{imageUrl}}/pay_select.png"></image>                        
        </view>
    </view>
    <view class="rechargeBottom">
        <view class="text" wx:if='{{rechargeAmount}}' hidden="{{!isShowtips||isShowMaiXiang}}">到账金额：{{rechargeAmount}}+{{presentAmount}}={{util.addition(presentAmount,rechargeAmount)}}元</view>
        <view class="rechargeBtn" bindtap='getRechargeInfo'>我要充值</view>
        
    </view>
</view>
<wxs module="util">
    var formatNum=function(n){ 
        return Number(n) 
    } 
    var formatNumber =function(n){
        n = n.toString()
        return n[1] ? n : '0' + n
      }
    var formatDate=function(millisecond){
        var  date=getDate(millisecond),
         year = date.getFullYear(),
         month = date.getMonth() + 1,
         day = date.getDate(),
         hour = date.getHours(),
         minute = date.getMinutes(),
         second = date.getSeconds();
        return [year, month, day].map(formatNumber).join('-') + '   '+' ' + [hour, minute].map(formatNumber).join(':')
    } 
    var addition=function(a,b){
        return  Number(a)+Number(b)
    }
    module.exports = { 
        formatNum : formatNum, 
        formatDate:formatDate,
        addition:addition
    }
</wxs>